var  sylvester=require("sylvester");
$V([1,2]).snapTo
console.log($P) ;

/* var a = $V([10,5]);
var b = $V([5,5]); */

// var c = a.rotate(Math.PI/2, b);
// c is the point (5,10)
/**
 *
 *
 * @param {Vector} x1
 * @param {Vector} x2
 */
function getTheMinsum(x1,x2){

    var x3=x1.add(x2.multiply(-1));
    var v1=x2.add(x3.rotate(-Math.PI/3,$V([0,0])));//
    
    var v2=x1.rotate(Math.PI/3,$V([0,0])).add(x2.multiply(-1));
    var ks=$M([x2.elements]) .multiply($M([v1.elements,v2.elements]).inverse());
   return v1.multiply(ks.elements[0][0]) ; 
}
// var x1=$V([1,Math.sqrt(3)]);
// var x2=$V([2,0]);
var point1=$V([113.422315,23.125696]);
var point3=$V([113.373171,23.104508]);
var point2=$V([113.384043,23.125398]);
// var point2=$V([-1,0]);
// var point1=$V([1,0]);
// var point3=$V([0,Math.sqrt(3)]);
var x1=point2.add(point1.multiply(-1));
var x2=point3.add(point1.multiply(-1));
var x3= getTheMinsum(x1,x2);
console.log(point1.add(x3).elements)
